<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app"></div>
  <script>
    // 补零函数
    function zer(num) {
      return num > 9 ? num : '0' + num;
    }
    function fn() {
      var d = new Date();
      var y = d.getFullYear();
      var month = d.getMonth();
      var dd = zer(d.getDate());

      var hour = zer(d.getHours() + 1);
      var mm = zer(d.getMinutes());
      var ss = zer(d.getSeconds());
      var result = `${y}年${month}月${dd}日${hour}时${mm}分${ss}秒`;
      document.querySelector('#app').innerHTML = result;
      
    }
    fn()

    setInterval(fn, 1000);


  </script>

</body>

</html>